package com.cyz.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cyz.common.bean.CardButton;
import com.cyz.admin.service.CardButtonService;
import com.cyz.common.mapper.CardButtonMapper;
import org.springframework.stereotype.Service;

/**
* @author 34928
* @description 针对表【card_button】的数据库操作Service实现
* @createDate 2023-02-28 12:55:06
*/
@Service
public class CardButtonServiceImpl extends ServiceImpl<CardButtonMapper, CardButton>
    implements CardButtonService{

//    @Autowired
//    private ButtonService buttonService;

//    @Override
//    public List<String> getbuttonNamesByCardId(Integer id) {
//        LambdaQueryWrapper<CardButton> lambdaQueryWrapper = new LambdaQueryWrapper<>();
//        lambdaQueryWrapper.eq(CardButton::getCardId,id);
//        List<CardButton> list = list(lambdaQueryWrapper);
//        List<String> buttonNames = new ArrayList<>();
//        list.stream()
//                .map(CardButton::getButtonId)
//                .forEach(item ->{
//                    buttonNames.add(buttonService.getById(item).getName());
//                });
//        return buttonNames;
//    }
//
//    @Override
//    public List<Integer> getbuttonIdsByCardId(Integer id) {
//        LambdaQueryWrapper<CardButton> lambdaQueryWrapper = new LambdaQueryWrapper<>();
//        lambdaQueryWrapper.eq(CardButton::getCardId,id);
//        List<CardButton> list = list(lambdaQueryWrapper);
//        List<Integer> buttonIds = new ArrayList<>();
//        list.stream()
//                .map(CardButton::getButtonId)
//                .forEach(item ->{
//                    buttonIds.add(buttonService.getById(item).getId());
//                });
//        return buttonIds;
//    }
}




